import 'package:time/http/response/base_page_bean.dart';

typedef ResponseSuccessCallback<T> = void Function(T? result);
typedef ResponseSuccessListCallback<T> = Function(List<T>? result);
typedef ResponseSuccessPageCallback<T> = Function(BasePageBean<T>? result);

typedef ResponseErrorCallback = Function(int? errorCode, String? errMsg);

class HttpRequestCallback<T> {
  /// 成功回调
  ResponseSuccessListCallback<T>? onSuccessList;
  ResponseSuccessPageCallback<T>? onSuccessPage;
  ResponseSuccessCallback<T>? onSuccess;

  /// 失败回调
  ResponseErrorCallback? onError;

  String className;

  /// {}  参数可选
  HttpRequestCallback(this.className, {this.onSuccess, this.onSuccessList, this.onSuccessPage, this.onError});
}
